<template>
  <div class="ruzhu">
      <div>
          <div class="header">
          <div class="header-title">入驻歌手</div>
      </div>
      <div class="body">
          <template v-loading="loading">
              <ul class="body-ul" v-infinite-scroll="load" infinite-scroll-disabled="disabled">
              <li v-for="v in hotList_detail" :key="v.id">
                  <div class="div_img" :title="`${v.name}的音乐`" @click="$router.push(`/singerMus/${v.id}`)">
                      <a href="javascript:;" class="a_img" >
                          <img :src="v.picUrl" alt="">
                      </a>
                  </div>
                  <div class="div_name">
                      <span class="singer_name" :title="`${v.name}的音乐`" @click="$router.push(`/singerMus/${v.id}`)">{{v.name }}</span>
                      <i class="el-icon-user-solid" :title="`${v.name}的个人主页`" @click="$router.push(`/geren/${v.id}`)" v-show="v.accountId"></i>
                  </div>
              </li>
          </ul>
          <p v-if="loading">加载中...</p>
          </template>
      </div>
      </div>
  </div>
</template>

<script>
import { getHotList } from '@/api/singers'
export default {
  data () {
    return {
      hotList_detail: '',
      num: 50,
      loading: true
    //   isShowGeren: true
    }
  },
  created () {
    this.getHotListD()
  },
  methods: {
    async getHotListD () {
      const { data } = await getHotList({ limit: this.num })
      console.log(data)
      this.hotList_detail = data.artists
    },
    load () {
      this.num += 10
      this.getHotListD()
    }
  },
  computed: {
    disabled () {
      return this.loading
    }
  }
}
</script>

<style lang="less" scoped>
.ruzhu {
    .header {
         height: 40px;
          padding: 0;
          border-bottom: 2px solid #c20c0c;
          .header-title {
              float: left;
              font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
            font-size: 24px;
            font-weight: normal;
          }
          .more {
            float: right;
            padding-top: 10px;
            &:hover {
            cursor: pointer;
            color: #c20c0c;
            text-decoration: underline;
            }
          }
    }
    .body {
        position: relative;
        width: 100%;
        padding-top: 20px;
        ul {
            // display: flex;
            width: 720px;
            // height: 368px;
            list-style:none;
            li {
                float: left;
                width: 130px;
                height: 184px;margin-right: 17px;
                span:hover {
                    cursor: pointer;
                    text-decoration: underline;
                }
                &:nth-child(5n) {
                    margin: 0;
                }
                .div_img {
                    .a_img {
                        display: block;
                        width: 100%;
                        height: 130px;
                        img {
                            width: 100%;
                            height: 130px;
                            background-color: #fff;
                        }
                    }
                }
                .div_name {
                    width: 130px;
                    padding-top: 8px;
                    .singer_name {
                        float: left;
                        font-size: 12px;
                    }
                    .el-icon-user-solid {
                        float: right;
                        color: #c20c0c;
                        &:hover {
                            cursor: pointer;
                        }
                    }
                }
            }
        }
    }
}
</style>
